import Vue from 'vue'
import App from './App.vue'
import router from './router'
import store from './store'
Vue.config.productionTip = false
import "./singleSpa"
// import {registerApplication,start} from "single-spa"
// async function loadScript(url){
//   return new Promise((resolve,reject)=>{
//     let script = document.createElement("script")
//     script.src = url
//     script.onload = resolve
//     script.onerror = reject
//     document.head.appendChild(script)
//   })
// }

// registerApplication("asdasda",async ()=>{
//   await loadScript('http://192.168.21.108:9974/js/chunk-vendors.js') // 子项目运行环境
//   await loadScript('http://192.168.21.108:9974/js/app.js') // 子项目运行环境
//   return window.child1 // bootstrap mount unmount
// },
//   location =>{
//     return location.pathname.startsWith("/vue")
//   },
//   {data:store}
// )
// registerApplication("www",async ()=>{
//   await loadScript('http://192.168.21.108:9975/js/chunk-vendors.js') // 子项目运行环境
//   await loadScript('http://192.168.21.108:9975/js/app.js') // 子项目运行环境
//   return window.child2 // bootstrap mount unmount
// },
//   location =>location.pathname.startsWith("/child2"),
//   {data:store}
// )
// start()
new Vue({
  router,
  render: h => h(App),
  store
}).$mount('#app')